package com.hiber.running;

import java.sql.Date;
import java.util.List;

import com.hiber.domain.User;
import com.hiber.dao.UserDAO;

public class Main {

	public static void main(String[] args) {
		UserDAO dao = new UserDAO();
		User user = new User();
		user.setId(4L);
		user.setName("***");
		user.setSurname("###");
		user.setBirtday(new Date(2133444L));
		//dao.addUser(user);
		//User u = dao.findUserById(2L);
		//System.out.println("Name:"+u.getName()+"\nSurname:"+u.getSurname()+"\nBirthday:"+u.getBirtday());
		//dao.deleteUser(1L);
		dao.updateUser(user);
		List listUsers = dao.findAllUsers();
		for(Object ob: listUsers) {
			User u = (User)ob;
			System.out.println("id="+u.getId()+"\nName:"+u.getName()+"\nSurname:"+u.getSurname()+"\nBirthday:"+u.getBirtday()+"\n");
		}
	}

}
